#include <cstdio>

int main( )
{
    int n, ans;
    while ( scanf("%d", &n) != EOF )
    {
        ans = 1;
        while ( n )
        {
            if ( n & 1 ) ans <<= 1;
            n >>= 1;
        }
        printf("%d\n", ans);
    }
    return 0;
}
